//Textbox{
function MaxWordsValidate(sender, eventArgs) {
    var textbox = jQuery('#' + sender.controltovalidate);
    if (WordCount(textbox.val()) > 100) {
        eventArgs.IsValid = false;
        return;
    }
    eventArgs.IsValid = true;
}

function WordCount(s) {
    s = s.replace(/(^\s*)|(\s*$)/gi, "");//exclude  start and end white-space
    s = s.replace(/[ ]{2,}/gi, " ");//2 or more space to 1
    s = s.replace(/\n /, "\n"); // exclude newline with a start spacing
    return s.split(' ').length;
}
//}

//SubmitButton{
function Submit_Form(sender, eventArgs) { //submitbuttons
    if (Page_ClientValidate("Submission")) {
        jQuery(sender).addClass("notClickable");
        jQuery(sender).val("Submitting..")
    }
}
//}